package me.yushuai.wukong.base.repository;

import me.yushuai.wukong.base.entity.ConfigValue;
import me.yushuai.wukong.common.persistence.repository.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhoushuai@189.cn
 * @since 2023-04-03
 */
@Repository
public interface ConfigValueRepository extends BaseRepository<ConfigValue, Long> {

    /**
     * 查询配置下所有可选值
     *
     * @param bizId 配置的业务Id
     * @return 返回配置下的所有可选值
     */
    @Query("from ConfigValue where confDefId = ?1")
    List<ConfigValue> findAllByConfDefBizId(String bizId);
}
